//{ "allowMappedTypes": "in-unions-and-intersections" }
type Foo<T, U> =
  | { readonly [P in keyof T]: T[P] }
  | { readonly [P in keyof U]: U[P] };

type Foo<T, U> = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] };

type Foo<T, U> = { readonly [P in keyof T]: T[P] } & {
  readonly [P in keyof U]: U[P];
};

type Foo<T, U> = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] };

type Foo<T> =
  | {
  readonly [P in keyof T]: T[P];
}
  | {
  readonly [P in keyof T]: T[P];
};

type Foo<T> = {
  readonly [P in keyof T]: T[P];
} & {
  readonly [P in keyof T]: T[P];
};

